package com.online.service;

import com.online.dao.PaperMapper;
import com.online.entity.Paper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PaperServiceImpl implements PaperService {

    @Autowired
    PaperMapper paperMapper;

    public int addARecordByExamId(Paper paper) {
        return paperMapper.insertARecord(paper);
    }

    @Override
    public List<Integer> showAllQuestionId(Integer examId, Integer questionType) {
        return paperMapper.selectQuestionId(examId,questionType);
    }

    @Override
    public int deleteARecord(int examId) {
        return paperMapper.deleteARecord(examId);
    }

    @Override
    public List<Paper> showPaperByExamId(Integer examId) {
        return paperMapper.showARecord(examId);
    }

    @Override
    public Paper showRecord(String studentNumber, Integer questionType, Integer examId, Integer questionENumber) {
        return paperMapper.showRecord(studentNumber,questionType,examId,questionENumber);
    }
}
